package Day02;

import java.util.Scanner;

public class Youketest {
    public static void main(String[] args) {
        while (true) {
            Youke num1 = new Youke();
            Scanner scan = new Scanner(System.in);
            System.out.print("请输入姓名：");
            num1.name = scan.next();
            if (num1.name.equals("n")) {
                System.out.println("程序退出");
                return;
            }
            System.out.print("请输入年龄：");
            num1.age = scan.nextInt();
            while (num1.age < 0 || num1.age > 150) {
                System.out.println("输入错误");
                num1.age = scan.nextInt();
            }
            int piaojia = num1.getPrice();
            System.out.println("这个游客" + num1.name + "，年龄为" + num1.age + "，应付票价：" + piaojia + "元。");
            System.out.println("*******************");
        }
        
    }


}
